package cn.pengpeng.day05.mywc;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.Partitioner;

public class WordPartitioner extends Partitioner<Bean, NullWritable>{
	
	public WordPartitioner() {
		System.out.println("WordPartitioner类被实例化了................................");
	}
	
	

	@Override
	public int getPartition(Bean key, NullWritable value, int numPartitions) {
		System.out.println("getPartition方法执行了.....................................");
		return (key.getWord().hashCode() & Integer.MAX_VALUE) % numPartitions;
	}

}
